﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Skynet.BusinessLogic.DataAccess;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.Unity;
using Skynet.BusinessEntities;
namespace Skynet.BusinessLogic.DataAccess
{
    public  class KindDABRepository : IKindRepository
    {

        [Dependency("SkynetLibrary")]
        public Database SkynetLibraryDB { get; set; }


        public void Add(Kind item)
        {
            throw new NotImplementedException();
        }

        public void Add(IEnumerable<Kind> items)
        {
            throw new NotImplementedException();
        }

        public void Update(Kind item)
        {
            throw new NotImplementedException();
        }

        public void Update(IEnumerable<Kind> items)
        {
            throw new NotImplementedException();
        }

        public void Delete(Kind item)
        {
            throw new NotImplementedException();
        }

        public void Delete(IEnumerable<Kind> items)
        {
            throw new NotImplementedException();
        }

        public Kind GetOne(object key)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<Kind> GetAll()
        {            
            var mapper = MapBuilder<Kind>.MapAllProperties().Build();            
            var result = this.SkynetLibraryDB.ExecuteSqlStringAccessor<Kind>("select * from  kinds", mapper);
            return result;
        }


        public Kind GetByTitle(string Title)
        {
            throw new NotImplementedException();
        }
    }
}
